@inherits FunnelWeb.Web.App_Code.HelperPage
@using System.Web.Mvc
@using System.Web.Mvc.Html

@helper Render(string actionName, int currentPageNumber, int totalPages)
  {
  if (totalPages > 1)
  { 
  <div class="paginator">
    <span class="title">Page: </span>
    @for (var i = 0; i < totalPages; i++)
    {
    <span class="page">
      @if (i == currentPageNumber)
      { 
        @System.Web.Mvc.MvcHtmlString.Create((i + 1).ToString())
      }
      else if (i == 0)
      { 
        @Html.ActionLink((i + 1).ToString(), actionName) 
      }
      else
      { 
        @Html.ActionLink((i + 1).ToString(), actionName, new { pageNumber = i }) 
      }
    </span>
    }
  </div>
  }
  
}


